import {api} from './libs/api.js';
let _self;
export const index =  {
	data() {
		return {
			optLock:false,
			formData:{},
		}
	},
	
	mounted() {
		_self = this;
	},
	onReachBottom:function(e){
		/*this.params.page+=1;
		this.initData();*/
	},
	onLoad:function(option) {
		//this.tabSubItem=option.status;
	},
	
	methods: {
		async initData(){
			this.formData=await api.getProConfig({});
		},
		
		async submitForm(){
			if(this.optLock){
				uni.showToast({icon:"none",title:"请不要重复提交！"});
				return false;
			}
			this.optLock=true;			
			let retInfo=await api.setProConfig(this.formData);
			if(retInfo=="success"){
				uni.showToast({icon:"none",title:"修改成功！"});
				setTimeout(function(){uni.switchTab({url:"/pages/user/index"});},2000);　　
			}else{
				this.optLock=false;
			}
			
		}
				
	},
}